home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / converte / c_ilbm21.lha / DocsEnglish / ConvertiILBM.doc < prev    next >
Encoding:
Text File  |  1994-02-16  |  23.0 KB  |  480 lines

  1.  
  2.  
  3. --------------------------------------------------------------------------
  4.                              ConvertiILBM 2.1
  5.  
  6.                            by Massimo Tantignone
  7.                             © 1989-1994 MT Soft
  8. --------------------------------------------------------------------------
  9.  
  10.  
  11.    1. PRESENTATION OF THE PROGRAM
  12.  
  13.    The program ConvertiILBM allows to convert any file that is in the
  14. IFF ILBM format into several other formats, among which icons, Sprites,
  15. BOBs, source code in various languages and raw binary files, and is also
  16. able to display it and examine its more significant chunks.
  17.    In addition it offers a number of options to vary the characteristics
  18. of some of the file types being produced.
  19.  
  20.    The program handles IFF ILBM files of any resolution and graphic mode,
  21. including HAM, EXTRA-HALFBRITE and overscan.
  22.    It doesn't support the new AGA graphic modes yet, because I don't own
  23. an Amiga 4000 (but it is only a matter of time).
  24.  
  25.    All conversion functions can be used both from Shell and from Workbench;
  26. displaying files from Workbench also supports extended selection and the
  27. indication of ConvertiILBM as Default Tool in an ILBM file's icon.
  28.  
  29.    The program is compatible with any Amiga operating system, it works on
  30. PAL and NTSC machines, it can save the preferred settings into its icon and
  31. it can be adapted to any language (using the locale.library under 2.1 or
  32. higher and with another method under 2.04 or lower).
  33.  
  34.    ConvertiILBM will come useful mainly to programmers wanting to include
  35. images and animations into theirs applications, but even other users could
  36. find useful, for instance, the possibility of converting their pictures
  37. into Workbench icons.
  38.  
  39.    Because with version 2.0 ConvertiILBM has been almost completely rewritten
  40. and features noticeable differences compared to ConvertiILBM 1.4, I suggest
  41. you to read entirely the present documentation, even if you are already
  42. familiar with the previous version (non-italian users probably have never
  43. heard of ConvertiILBM before anyway).
  44.  
  45. NOTE: The italian version of this documentation is somewhat more detailed
  46. than the english one. Feel free to translate entirely the original doc file
  47. and to include it into the distribution directory of ConvertiILBM. I doubt
  48. I'll ever find the time to do this myself.
  49.  
  50.  
  51.    2. PURPOSE AND MOTIVATIONS
  52.  
  53.    Often Amiga programmers find themselves in need of inserting bitmapped
  54. images into their applications, but to do this these images must be in an
  55. appropriate format.
  56.    In fact a program could load from disk a IFF graphic file at run time,
  57. but usually it is preferred, for small applications, to code the image data
  58. directly in the executable, or, in the case of games or already very large
  59. programs, to load from disk raw binary files that are easier to handle at
  60. the input/output level.
  61.    Sometimes, then, the format is imposed by the programming language being
  62. used; for instance, in AmigaBASIC it is possible to read from disk the BOBs
  63. or the VSprites to be used in one's own animations, but only if the file
  64. containing them is structured as those produced by the ObjEdit program.
  65.    Finally, both the programmer and the user have often the desire or the
  66. need of customizing the icons of their own files, and to do that usually
  67. they need a drawing program that allows them to save their work as a
  68. Workbench icon (such as IconEd or IconEdit).
  69.  
  70.    Alas, not all drawing programs allow to save images into all of these
  71. different formats, which means that it is almost always necessary to use
  72. a different program for each one of them.
  73.    That may be problematic, as there are few really valid format-specific
  74. drawing programs, and in some cases it is available only one such program,
  75. and furthermore not a particularly reliable one (as, for instance, in the
  76. case of the already mentioned ObjEdit for the AmigaBASIC BOB or VSprite
  77. files).
  78.  
  79.    The only solution in these cases is to use one drawing program, for
  80. instance DeluxePaint, to create all needed images, and then to "convert"
  81. them into the required format through the use of other programs, coming
  82. usually from the public domain. The problem, however, that way is merely
  83. postponed: we fall back into the necessity of having a different conversion
  84. program for each format we may need.
  85.    Besides, by converting the images outside the program with which they
  86. were created, one risks to get confused about the names of two different
  87. images, or to not remember the exact contents of a file, especially after
  88. some time; therefore it is often also needed a displayer to have a look at
  89. the images before converting them.
  90.  
  91.    To resolve all these problems I created ConvertiILBM.
  92.  
  93.    ConvertiILBM gathers into one program the functions of several others
  94. converters and displayers, from public domain and not, and therefore it
  95. eliminates the need to have many editing programs allowing to use only one
  96. (such as the DPaint) whatever be the file type you want to obtain in the
  97. end.
  98.    Thanks to ConvertiILBM you shall be able to eliminate from your disks
  99. or from your hard disk the programs:
  100.  
  101.    IconEd
  102.    IconMerge
  103.    IE
  104.    LoadILBM-SaveACBM
  105.    ObjEdit
  106.    Gi
  107.    ZapIcon
  108.  
  109. and all their equivalents, as well as several simple displayers such as
  110. Show, SeeILBM, Display, and so on.
  111.    However, because the display ConvertiILBM does is very simple and its
  112. purpose is only to give a look at the files being converted, the program
  113. can't replace more powerful displayers such as, for instance, ViewTek by
  114. Thomas Krehbiel or Mostra by Sebastiano Vigna, currently the best ones in
  115. circulation.
  116.  
  117.    To sum it all up, now you can draw with the DPaint your icons, your BOBs
  118. or Sprites to use in your AmigaBASIC animations, and generally all images
  119. you may want to insert into your programs.
  120.    I think that using the DPaint is better than using IconEd or ObjEdit,
  121. as they in addition to being obsolete also are not much powerful and
  122. definitely uncomfortable for the user (not to mention their many bugs: I
  123. never managed to conclude a work session with ObjEdit without getting a
  124. visit from the Guru).
  125.    Even if with the release 2.0 of the operating system the IconEd program
  126. (now IconEdit) has been remarkably enhanced, certainly it is not yet in
  127. the DPaint's league. Furthermore, although IconEdit allows now to import
  128. IFF files, they get "cut" if they exceed the maximum accepted size (rather
  129. small). ConvertiILBM, instead, doesn't impose limits on the icon size.
  130.  
  131.  
  132.    3. GENERAL INFORMATION
  133.  
  134.    3.1  For those already knowing ConvertiILBM 1.x (all the five of them)
  135.  
  136.    ConvertiILBM 2.x is a new version of the program and not a simple
  137. revision. From version 1.4 were introduced several enhancements, changes,
  138. additions and corrections. So read on!
  139.  
  140.  
  141.    3.2  For all users
  142.  
  143.    ConvertiILBM can currently convert an IFF ILBM file into the following
  144. formats: ACBM file, uncompressed ILBM file, source code (BASIC, C, Modula-2
  145. or Assembler), raw binary file, C source code for a sprite, icon (a new one
  146. or an alternate image) and AmigaBASIC VSprite and BOB file.
  147.    Most conversion types present some specific options allowing you to
  148. configure the produced file; for instance you can decide whether to add or
  149. not a colormap to a source code file or to a raw binary file, or whether
  150. the bitmap of the generated file must be contiguous or interleaved, or even
  151. the number of spaces to be used for the indentation of a source code's
  152. lines.
  153.    In order to make it easier to identify the desired ILBM files before
  154. converting them, the program allows you also to display an ILBM file and
  155. to examine the contents of its more significant chunks.
  156.    From CLI/Shell you can perform a single operation for each time, by
  157. running ConvertiILBM and specifying on the command line the names of the
  158. input and output files, the conversion type and/or the desired options, if
  159. any.
  160.    From the Workbench you can instead perform many conversions in one
  161. session, by using a comfortable control panel that appears when you
  162. double-click on the program's icon.
  163.    While working this way it is also possible to save the current settings
  164. of the panel into the ConvertiILBM's icon; this way every time you execute
  165. the program from Workbench these settings will get restored. The saved
  166. setting will instead be ignored if you use ConvertiILBM from CLI/Shell.
  167.  
  168.    IMPORTANT NOTE: To be able to use the control panel under 1.3 (or
  169.    lower) it is necessary that in your system's LIBS: directory be present
  170.    a PD library emulating the gadtools.library, as the one I made and
  171.    included with the program. If you are still using the 1.3 operating
  172.    system, then, copy into your LIBS: directory the file called
  173.    "gadtools_34.library" that comes with ConvertiILBM and rename it to
  174.    "gadtools.library" (if you don't rename it the program won't find it,
  175.    I do not distribute it directly with the name "gadtools.library" as I
  176.    suspect that name to be copyrighted).
  177.    I realize all that may end up to be annoying, but this is only another
  178.    reason you SHOULD update your Amiga and install at least the Release 2
  179.    of the operating system, if not an even higher one.
  180.  
  181.  
  182.    4. USAGE FROM SHELL
  183.  
  184.    4.1  Template
  185.  
  186.    FROM/A,TO,CONVERSIONTYPE,LANGUAGE,ICONTYPE,SHOW/S,EXAM=EXAMINE/S,
  187.    CMAP=COLORMAP/S,INTERL/S,BHEADER/S,NOTRANSBACK/S,PAINTBRUSH/S,
  188.    WIDTH/K/N,TAB/S,INDENT/K/N,JOINLINES/S,TEXTFILE/K,GUI/S
  189.  
  190.    A keyword like CMAP=COLORMAP means you can use without any distinction
  191. CMAP as well as COLORMAP (i. e. the two keywords are equivalent).
  192.  
  193.  
  194.    4.2  Explanation of the template
  195.  
  196.    FROM
  197.       Name of the input ILBM file. Do not type "FROM" literally but only
  198.       the file name. Specifying only that argument causes the display of
  199.       the file.
  200.  
  201.    TO
  202.       Name of the output converted file. Do not type "TO" literally but
  203.       only the file name.
  204.  
  205.    CONVERSIONTYPE    [default: SOURCE]
  206.       Type of conversion to be performed. Don't type "CONVERSIONTYPE"
  207.       literally but only the name of the conversion type. The current
  208.       available types are:
  209.  
  210.          ACBM       IFF ACBM (Amiga Contiguous BitMap) graphic file
  211.          ILBM       IFF ILBM (InterLeaved BitMap) uncompressed file
  212.          SOURCE     Source code file in ASCII format
  213.          BYTES      Raw binary file with plain image data
  214.          SPRITE     C source code with a sprite's definition and image data
  215.          ICON       Workbench icon file (new or alternate image)
  216.          VSPRITE    AmigaBASIC VSprite binary file
  217.          BOB        AmigaBASIC BOB binary file
  218.  
  219.    LANGUAGE          [default: C]
  220.       Language of the source code to be produced (if SOURCE specified).
  221.       Don't type "LANGUAGE" but only the name of the language. The
  222.       currently available languages are:
  223.  
  224.          BAS=BASIC        AmigaBASIC language
  225.          C                C language
  226.          M2=MODULA2       Modula-2 language
  227.          ASM=ASSEMBLER    Assembly language
  228.  
  229.    ICONTYPE          [default: PROJECT]
  230.       Type of the icon to be produced (if ICON specified). Don't type
  231.       "ICONTYPE" but only the name of the type. The possible types are:
  232.  
  233.          TOOL        Icon of an executable program
  234.          PROJECT     Icon of a data file
  235.          DRAWER      Icon of a directory (drawer)
  236.          DISK        Icon of a disk or device
  237.          TRASHCAN    Icon of the Trashcan
  238.  
  239.       By specifying APPEND it is not created a new icon, but the image of
  240.       the ILBM file is appended to an already existing icon file to form
  241.       an icon with an alternate image.
  242.  
  243.    SHOW
  244.       Switch to have ConvertiILBM display the ILBM file. Press any key
  245.       or mouse button to end the display.
  246.  
  247.    EXAM=EXAMINE
  248.       Switch to have ConvertiILBM examine the ILBM file, printing a
  249.       list of the more significant chunks along with their contents, if
  250.       applicable. The program currently recognizes the BMHD, CMAP, CAMG,
  251.       GRAB and BODY chunks; of course of the last one will be showed the
  252.       length only.
  253.  
  254.    CMAP=COLORMAP     [default: no colormap]
  255.       Switch to have ConvertiILBM include a colormap in the output file.
  256.       This is applicable only to the SOURCE, SPRITE and BYTES conversion
  257.       types. The colormap for a raw binary file is appended at the end of
  258.       the file and consists of a number of words (2 bytes), a word for
  259.       each color, in the same format used by the LoadRGB4() function.
  260.  
  261.    INTERL            [default: contiguous bitmap]
  262.       Switch to have ConvertiILBM output a file with an interleaved bitmap,
  263.       as opposed to a file with a contiguous bitmap. This is applicable
  264.       only to the SOURCE and BYTES conversion types.
  265.  
  266.    BHEADER           [default: no BASIC header]
  267.       Switch to have ConvertiILBM add a 3 word (6 bytes) header to the
  268.       raw binary files it produces, containing the values of width, height
  269.       and depth of the image. Useful to load the binary file directly into
  270.       an AmigaBASIC array to use with the GET/PUT instructions.
  271.  
  272.    NOTRANSBACK       [default: transparent background]
  273.       Switch to have ConvertiILBM generate a BOB file with a non-trasparent
  274.       background. The background will be solid and of color 0.
  275.  
  276.    PAINTBRUSH        [default: BOB preserves background]
  277.       Switch to have ConvertiILBM generate a BOB file that doesn't preserve
  278.       the background which it moves on, leaving a trail like a paintbrush.
  279.  
  280.    WIDTH=<columns>   [default: 76, minimum: 16]
  281.       Formatting option to specify the maximum line width of the source
  282.       code produced (if SOURCE specified). The hexadecimal image data won't
  283.       exceed that width but will go instead onto the next line.
  284.       By specifying WIDTH=UNLIMITED (or anything beginning with an U) the
  285.       program will insert a newline only after a full line of image data.
  286.  
  287.    TAB               [default: use spaces]
  288.       Formatting switch to have ConvertiILBM use tabs instead of spaces to
  289.       do the indent in the source code it produces.
  290.  
  291.    INDENT=<characters>  [default: 3, minimum: 0]
  292.       Formatting options to specify the size of the indent of the source
  293.       code to be produced. If TAB is also used, make sure your editor's
  294.       tab size to be the same as what you specify with this option.
  295.  
  296.    JOINLINES         [default: do not join lines]
  297.       Formatting switch to have ConvertiILBM put as much data as possible
  298.       (with respect to what specified with WIDTH) onto a single source code
  299.       line, that is it won't insert a newline between consecutive image
  300.       data lines. Do not specify both JOINLINES and WIDTH=UNLIMITED or your
  301.       code will end up being composed by a single, long line of text.
  302.  
  303.    TEXTFILE=<filename>  [default: "S:ci.txt"]
  304.       Option to select an ASCII text file containing the strings used by
  305.       ConvertiILBM, useful to configure it to any language. Do not create
  306.       these files by yourself, but use or modify (translate) one of those
  307.       included with the program. However, if locale.library is available,
  308.       use Amiga's standard localization system instead of this method.
  309.       See also paragraph 6, "Localization" for more information.
  310.  
  311.    GUI                  [default: no GUI]
  312.       Switch to have ConvertiILBM open its control panel as if launched
  313.       from the Workbench. All other parameters are taken into consideration
  314.       and used to configure the panel at its opening.
  315.       GUI is the acronym of "Graphic User Interface".
  316.  
  317.    Lastly, by typing "ConvertiILBM ?" you'll get a reminder of the standard
  318. template, while typing "ConvertiILBM ??" (with two question marks) the more
  319. traditional syntax will be displayed, as follows:
  320.  
  321.    ConvertiILBM 2.1 by Massimo Tantignone - © 1994 MT Soft
  322.    Usage: WORK:ConvertiILBM <Input file> [<Output file>]
  323.      [ACBM | ILBM | SOURCE | BYTES | SPRITE | VSPRITE | BOB | ICON]
  324.      [BAS=BASIC | C | M2=MODULA2 | ASM=ASSEMBLER]
  325.      [TOOL | PROJECT | DRAWER | DISK | TRASHCAN | APPEND]
  326.      [SHOW]         [EXAM=EXAMINE]  [CMAP=COLORMAP]  [INTERL]  [BHEADER]
  327.      [NOTRANSBACK]  [PAINTBRUSH]        [WIDTH=<n>]  [INDENT=<n>]  [TAB]
  328.      [JOINLINES]    [TEXTFILE=<file>]   [GUI]
  329.  
  330.    The parameters can be specified in any order and case, but the input
  331. file name must always come before the output file name.
  332.  
  333.  
  334.    5. USAGE FROM THE WORKBENCH
  335.  
  336.    5.1  Conversion from the Workbench
  337.  
  338.    ConvertiILBM can be used from the Workbench as a converter or as a
  339. displayer. To use it as a converter (main usage) simply start it by
  340. double-clicking on its icon. A control panel will pop up, with which
  341. you'll be able to do your conversions in an highly intuitive way.
  342.  
  343.    The control panel features several gadgets. In the upper part of the
  344. window you'll find two string gadgets to enter the names of the input and
  345. output files the program must operate on. Besides them there are also two
  346. button gadgets whose purpose is to display a file requester to quickly
  347. select the desired file names.
  348.    To create the file requester ConvertiILBM will try to locate and use,
  349. in this order, asl.library, reqtools.library or arp.library. If none is
  350. found, the button gadgets will be disabled at startup.
  351.    Note: reqtools.library is copyright © Nico François.
  352.    In the left half of the panel there is a series of mutual exclude
  353. gadgets to choose the main conversion type you want the program to perform.
  354.    Depending on the chosen type of conversion, the right half of the window
  355. shall contain some other gadgets to fine-tune the desired operation. Some
  356. conversion types, however, don't offer any additional gadgets.
  357.    The purpose and use of these gadgets should be intuitive as they have
  358. a direct corrispondence to the already described Shell parameters.
  359.    The rest of the panel's gadgets will trigger a particular action, for
  360. instance to display the input file or to actually execute the conversion.
  361.    The gadget labeled "Advanced options..." will bring up a second panel
  362. with which you'll be able to choose some formatting options for the source
  363. code the program will generate (only if you selected the conversion into
  364. source code or sprite).
  365.    With the Project menu you can save the current settings of the control
  366. panel into the program's icon (with the "Save settings" item). The settings
  367. will be used to configure the panel at the startup the next time you'll
  368. execute ConvertiILBM. Under 2.0 (or higher) the program can create an icon
  369. for itself if one doesn't already exists, while under 1.x it cannot.
  370.    Do not add, delete or modify by hand the tool types of the program's
  371. icon, except for the TEXTFILE tool type; if you add this tool type it will
  372. be preserved by ConvertiILBM at each new saving of the settings.
  373.    The other items of the Project menu are rather self-explanatory.
  374.  
  375.  
  376.    5.2  Display from the Workbench
  377.  
  378.    To display an IFF ILBM file from the Workbench using ConvertiILBM, all
  379. you have to do is to click on ConvertiILBM's icon and then, holding down
  380. the SHIFT key, click on the icon of any ILBM file you want to display,
  381. double-clicking only on the last one. It is however not necessary that
  382. ConvertiILBM be the first icon selected, it just has to be comprised in the
  383. extended selection.
  384.    Alternatively, you can set ConvertiILBM as the "Default Tool" in the
  385. Info (Information under 2.0+) window of the icon of an ILBM file, then
  386. simply double-click on that file. If ConvertiILBM isn't in the same drawer
  387. as the ILBM file, you must specify its full path in the "Default Tool"
  388. string gadget.
  389.    You can also mix the above methods; if you multi-select a series of ILBM
  390. files one of which has ConvertiILBM as the Default Tool, the program will
  391. be invoked for each one of them even if it wasn't directly part of the
  392. multiple selection.
  393.  
  394.  
  395.    5.3  Errors while displaying
  396.  
  397.    If any error occurs during a multiple display, a requester with an error
  398. message will pop up. If the error wasn't a fatal one the display shall
  399. continue after the requester has gone away.
  400.  
  401.  
  402.    6. LOCALIZATION
  403.  
  404.    If you are lucky enough to own the 2.1 or 3.x operating system, you can
  405. take full advantage of the localization capability of ConvertiILBM in the
  406. Amiga's soon-to-be standard way, namely by using the locale.library.
  407.    All you have to do is to copy the "convertiilbm.catalog" file for your
  408. language, if supplied, to the directory LOCALE:Catalogs/<langname>, where
  409. <langname> is the name of your locale language. For example, if you are
  410. italian, you could copy the file "Catalogs/italiano/convertiilbm.catalog"
  411. (found in the ConvertiILBM's distribuction directory) to the directory
  412. "LOCALE:Catalogs/italiano/" of your system, thus obtaining the localization
  413. file "LOCALE:Catalogs/italiano/convertiilbm.catalog".
  414.    Of course you must also, if you don't have already done that, set your
  415. preferred language with the Locale preferences editor.
  416.  
  417.    Even if you don't own the locale.library (or if you don't find a catalog
  418. file suited for you), you still can configure ConvertiILBM to a language
  419. different from english by using an alternate method.
  420.    You should use either the TEXTFILE keyword (from Shell) or the icon
  421. tool type of the same name to let ConvertiILBM know the location of an
  422. ASCII text file containing the program's strings in the desired language.
  423.    For example, if the name of your file is "cilbm.txt" and it is in the
  424. "WORK:Config/" directory, you could run ConvertiILBM from Shell with a
  425. command line like this:
  426.  
  427.    ConvertiILBM TEXTFILE=WORK:Config/cilbm.txt [other parameters here]
  428.  
  429. or set the tool type TEXTFILE=WORK:Config/cilbm.txt in the icon of the
  430. program.
  431.    Alternatively, you can simply put the text file in your S: directory
  432. and rename it to "ci.txt", as ConvertiILBM will search that by default.
  433.    Do not create such a text file from scratch by yourself, but use or
  434. simply translate into your language, if needed, one of those included with
  435. ConvertiILBM (tipically the english one, supplied only for that).
  436.  
  437.    Remember that the text file expedient, if used, overrides the "normal"
  438. localization method, even if locale.library is present. To avoid this, if
  439. you plan to use only the standard localization method, you must make sure
  440. that there is no "ci.txt" file in your system's S: directory (and obviously
  441. do not use the TEXTFILE keyword or tool type).
  442.  
  443. NOTE: If you make versions for other languages of the .catalog files, you
  444. are free (and welcome) to include them into the distribution directory of
  445. ConvertiILBM.
  446.  
  447. OTHER NOTE: When installing a new version of ConvertiILBM, make sure that
  448. you replace all localization files (the .catalog and/or ASCII file) with
  449. the new ones, otherwise the program could behave strangely.
  450.  
  451.  
  452.    7. CONCLUSION
  453.  
  454.    After the debugging phase I did not discover any more errors; however
  455. if you should find any let me know. Write to:
  456.  
  457.                           Massimo Tantignone
  458.                           Via Campagnoli, 4
  459.                           28100 Novara (NO)
  460.                                ITALY
  461.  
  462.            E-Mail: Massimo_Tantignone@skylink.aare.net.ch
  463.  
  464.    Write to this address also to give any suggestion about modifications
  465. and/or enhancements of the program, as well as to send to me any money
  466. contributions to support future versions (well, I tried that).
  467.  
  468.    I don't have any more to say: make a good use of the program, make a bad
  469. use of it if you wish, modify it, DISTRIBUTE IT, do all you want with it
  470. (except selling it).
  471.    To have any information write to the above address.
  472.    Oh, and forgive me for my very poor english.
  473.  
  474.  
  475.                                      Massimo Tantignone, 15 february 1994
  476.  
  477.  
  478.    And remember... "Only AMIGA makes it possible!"
  479.  
  480.